<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								商户编号：<input type="text" name="userId"/>
							</li>
							<li>
								订单编号：<input type="text" name="paymentOrderId"/>
							</li>
							<li>
								分润类型：<select name="moneyType" th:with="type=${@dict.getType('money_type')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>

							<li class="select-time">
								<label>创建时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>

							<li>
								<a id="btnSearch"  class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
	
			<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-warning" onclick="$.table.exportExcel()">
		            <i class="fa fa-download"></i> 导出
		        </a>
		        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		        <font><b>分润总金额：</b><span id="spanSumMoney" > </span>元</font>
				<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:hatchetAcqJifen:export">
						<i class="fa fa-download"></i> 导出
				 </a> -->
	        </div>
	        
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div> 
		</div>
	</div>
   	<div th:include="include :: footer"></div> 
    <script th:inline="javascript">
    	var moneyType = [[${@dict.getType('money_type')}]];
    	var tradeType = [[${@dict.getType('trade_type')}]];
        var prefix = ctx + "system/hatchetFenRun";
        $(function() {
        	//点击总金额清零
        	$("#btnSearch").click(function(){
        		$("#spanSumMoney").text(0);
        	});
            var options = {
                url: prefix + "/fenRunList",
				exportUrl: prefix + "/export", 
                modalName: "分润记录",
				search: false,
		        showExport: false,
               	columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '主键id',
					visible: false
				},
				{
					field : 'paymentOrderId', 
					title : '订单号',
					sortable: true
				},
				{
					field : 'createTime', 
					title : '创建时间',
					sortable: false
				},
				{
					field : 'complateTime', 
					title : '完成时间',
					sortable: false
				},
				{
					field : 'moneyType', 
					title : '分润类型',
					align : 'left',
					formatter: function(value, item, index) {
						if(item.sumMoney != null){
	            			$("#spanSumMoney").text(item.sumMoney);
	            		} 
	            		return $.table.selectDictLabel(moneyType, item.moneyType);
	            	} 
				},
				{
					field : 'userId', 
					title : '分润商户编号',
					sortable: true
				},
			
				{
					field : 'merName', 
					title : '商户名称',
					/* sortable: true */
				},
				{
					field : 'tradeMerName', 
					title : '交易商户名称',
					/* sortable: true */
				},
				{
					field : 'merchantId', 
					title : '交易商户编号',
					sortable: false
				},
				{
					field : 'rate', 
					title : '费率',
					sortable: false
				},
				{
					field : 'tradeType', 
					title : '交易类型',
					align : 'left',
					formatter: function(value, item, index) {
	            		return $.table.selectDictLabel(tradeType, item.tradeType);
	            	} 
				},
				
				{
					field : 'trxAmt', 
					title : '分润金额(元)',
					sortable: true
				},
				{
					field : 'cardNo', 
					title : '银行卡号',
					sortable: false
				}]
            };
            $.table.init(options);
        });

    </script>
</body>
</html>